package org.ajc.org.domain;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.Min;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ExcelTarget("员工管理")
public class Employee {
    @ApiModelProperty("员工id")
    private Long id;
    @ApiModelProperty("员工用户名")
    @Excel(name = "姓名",width = 15)//导出用的注解
    @ExcelEntity  //导入用的注解
    private String username;
    @ApiModelProperty("员工密码")
    @Excel(name = "密码",width = 25)//导出用的注解
    @ExcelEntity//导入用的注解
    private String password;
    @ApiModelProperty("员工邮箱")
    @Excel(name = "邮箱",width = 25)
    @ExcelEntity
    @Email(regexp = ".+@.+\\.com")
    private String email;
    @ApiModelProperty("员工图片")
    @Excel(name = "头像",width = 25)
    @ExcelEntity
    private String headImage;
    @ApiModelProperty("员工年龄")
    @Excel(name = "年龄", type = 10,width = 10)
    @ExcelEntity
    @Min(value = 1, message = "年龄 >= 1")
    private Integer age;
    @ExcelEntity
    private Department department;

}
